package com.zllkj.mm.adapter

import android.util.Log
import android.widget.TextView
import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import com.amap.api.services.core.PoiItem
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.zllkj.mm.R
import com.zllkj.mm.module.goods.vm.ItemCollectionsVM
import com.zllkj.mm.module.goods.vm.ItemPostImageVM
import com.zllkj.mm.module.home.fragments.vm.ItemSearchPoiResultVM
import com.zllkj.mm.util.JsonUtil
import com.zllkj.mm.util.common.PictureLoadUtil

class PoiSearchAdapter(layoutResId: Int, data: List<ItemSearchPoiResultVM?>?) :
        BaseQuickAdapter<ItemSearchPoiResultVM, BaseViewHolder>(layoutResId, data) {
    override fun convert(baseViewHolder: BaseViewHolder, vm: ItemSearchPoiResultVM) {
        Log.d("acthome","-->" + JsonUtil.GsonString(vm))
        baseViewHolder.getView<AppCompatTextView>(R.id.tv_poi_address_list).text = vm.detailAddress
        baseViewHolder.getView<AppCompatTextView>(R.id.tv_poi_address_distance).text = vm.distance.toString() + "米"

    }
}